﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace yibo.Models
{
    public class ArtBlogOperate
    {
        private ArtBlogDataContext db = new ArtBlogDataContext();


        public IQueryable<Article> GetAllArticleByBlogId(int blogId) {
            return from article in db.Article
                   where article.blogId == blogId
                   select article;
        }

      public void ArticleInsert(Article article) {
          db.Article.InsertOnSubmit(article);  
       }

      public IQueryable<Comment> GetAllCommentByArticleId(int articleId)
      {
          return from comment in db.Comment
                 where comment.articleId == articleId
                 select comment;
      }

    }
}